﻿namespace LocalizationLibrary.Reflection
{
    //.NET References
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Reflection;
    using System.Text;

    /// <summary>
    /// Represents a deployment part.
    /// </summary>
    public abstract class DeploymentPart
    {
        //Methods

        /// <summary>
        /// Gets all loaded assemblies.
        /// </summary>
        /// <returns>Loaded assemblies.</returns>
        public abstract Assembly[] GetAssemblies();

        /// <summary>
        /// Load the input <paramref name="DeploymentPartAsyncResult"/> parameter.
        /// </summary>
        /// <param name="deploymetPartAsyncResult">Represents the status of an asynchronous <see cref="XapDeploymentPart"/> loading operation.</param>
        /// <exception cref="ArgumentNullException">
        public abstract void Load(DeploymetPartAsyncResult deploymentPartAsyncResult);

        /// <summary>
        /// Publishes the input assembly.
        /// </summary>
        /// <param name="assembly"></param>
        public void PublishAssembly(Assembly assembly)
        {
            AssemblyManager.PublishAssemblyLoaded(assembly);
        }
    }
}
